import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/standing_book/receipt_info_entity.dart';
import 'package:enterprise_v6_app/app/data/entities/application/execute_entity.dart';


ReceiptInfoEntity $ReceiptInfoEntityFromJson(Map<String, dynamic> json) {
  final ReceiptInfoEntity receiptInfoEntity = ReceiptInfoEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    receiptInfoEntity.id = id;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    receiptInfoEntity.companyCode = companyCode;
  }
  final String? ticketNo = jsonConvert.convert<String>(json['ticketNo']);
  if (ticketNo != null) {
    receiptInfoEntity.ticketNo = ticketNo;
  }
  final String? ticketName = jsonConvert.convert<String>(json['ticketName']);
  if (ticketName != null) {
    receiptInfoEntity.ticketName = ticketName;
  }
  final String? planStartDate = jsonConvert.convert<String>(json['planStartDate']);
  if (planStartDate != null) {
    receiptInfoEntity.planStartDate = planStartDate;
  }
  final String? planEndDate = jsonConvert.convert<String>(json['planEndDate']);
  if (planEndDate != null) {
    receiptInfoEntity.planEndDate = planEndDate;
  }
  final String? departmentId = jsonConvert.convert<String>(json['departmentId']);
  if (departmentId != null) {
    receiptInfoEntity.departmentId = departmentId;
  }
  final String? departmentName = jsonConvert.convert<String>(json['departmentName']);
  if (departmentName != null) {
    receiptInfoEntity.departmentName = departmentName;
  }
  final String? applyDepartmentId = jsonConvert.convert<String>(json['applyDepartmentId']);
  if (applyDepartmentId != null) {
    receiptInfoEntity.applyDepartmentId = applyDepartmentId;
  }
  final String? applyDepartmentName = jsonConvert.convert<String>(json['applyDepartmentName']);
  if (applyDepartmentName != null) {
    receiptInfoEntity.applyDepartmentName = applyDepartmentName;
  }
  final String? ticketContent = jsonConvert.convert<String>(json['ticketContent']);
  if (ticketContent != null) {
    receiptInfoEntity.ticketContent = ticketContent;
  }
  final String? ticketAddress = jsonConvert.convert<String>(json['ticketAddress']);
  if (ticketAddress != null) {
    receiptInfoEntity.ticketAddress = ticketAddress;
  }
  final String? identityUserId = jsonConvert.convert<String>(json['identityUserId']);
  if (identityUserId != null) {
    receiptInfoEntity.identityUserId = identityUserId;
  }
  final String? identityUserName = jsonConvert.convert<String>(json['identityUserName']);
  if (identityUserName != null) {
    receiptInfoEntity.identityUserName = identityUserName;
  }
  final String? ticketSource = jsonConvert.convert<String>(json['ticketSource']);
  if (ticketSource != null) {
    receiptInfoEntity.ticketSource = ticketSource;
  }
  final String? applyUserId = jsonConvert.convert<String>(json['applyUserId']);
  if (applyUserId != null) {
    receiptInfoEntity.applyUserId = applyUserId;
  }
  final String? applyUserName = jsonConvert.convert<String>(json['applyUserName']);
  if (applyUserName != null) {
    receiptInfoEntity.applyUserName = applyUserName;
  }
  final ExecuteEntity? receiptInfo = jsonConvert.convert<ExecuteEntity>(json['receiptInfo']);
  if (receiptInfo != null) {
    receiptInfoEntity.receiptInfo = receiptInfo;
  }
  return receiptInfoEntity;
}

Map<String, dynamic> $ReceiptInfoEntityToJson(ReceiptInfoEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['companyCode'] = entity.companyCode;
  data['ticketNo'] = entity.ticketNo;
  data['ticketName'] = entity.ticketName;
  data['planStartDate'] = entity.planStartDate;
  data['planEndDate'] = entity.planEndDate;
  data['departmentId'] = entity.departmentId;
  data['departmentName'] = entity.departmentName;
  data['applyDepartmentId'] = entity.applyDepartmentId;
  data['applyDepartmentName'] = entity.applyDepartmentName;
  data['ticketContent'] = entity.ticketContent;
  data['ticketAddress'] = entity.ticketAddress;
  data['identityUserId'] = entity.identityUserId;
  data['identityUserName'] = entity.identityUserName;
  data['ticketSource'] = entity.ticketSource;
  data['applyUserId'] = entity.applyUserId;
  data['applyUserName'] = entity.applyUserName;
  data['receiptInfo'] = entity.receiptInfo?.toJson();
  return data;
}

extension ReceiptInfoEntityExtension on ReceiptInfoEntity {
  ReceiptInfoEntity copyWith({
    String? id,
    String? companyCode,
    String? ticketNo,
    String? ticketName,
    String? planStartDate,
    String? planEndDate,
    String? departmentId,
    String? departmentName,
    String? applyDepartmentId,
    String? applyDepartmentName,
    String? ticketContent,
    String? ticketAddress,
    String? identityUserId,
    String? identityUserName,
    String? ticketSource,
    String? applyUserId,
    String? applyUserName,
    ExecuteEntity? receiptInfo,
  }) {
    return ReceiptInfoEntity()
      ..id = id ?? this.id
      ..companyCode = companyCode ?? this.companyCode
      ..ticketNo = ticketNo ?? this.ticketNo
      ..ticketName = ticketName ?? this.ticketName
      ..planStartDate = planStartDate ?? this.planStartDate
      ..planEndDate = planEndDate ?? this.planEndDate
      ..departmentId = departmentId ?? this.departmentId
      ..departmentName = departmentName ?? this.departmentName
      ..applyDepartmentId = applyDepartmentId ?? this.applyDepartmentId
      ..applyDepartmentName = applyDepartmentName ?? this.applyDepartmentName
      ..ticketContent = ticketContent ?? this.ticketContent
      ..ticketAddress = ticketAddress ?? this.ticketAddress
      ..identityUserId = identityUserId ?? this.identityUserId
      ..identityUserName = identityUserName ?? this.identityUserName
      ..ticketSource = ticketSource ?? this.ticketSource
      ..applyUserId = applyUserId ?? this.applyUserId
      ..applyUserName = applyUserName ?? this.applyUserName
      ..receiptInfo = receiptInfo ?? this.receiptInfo;
  }
}
